home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / dbgrids.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  22.3 KB  |  558 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'DBGrids.pas' rev: 3.00
  6.  
  7. #ifndef DBGridsHPP
  8. #define DBGridsHPP
  9. #include <Menus.hpp>
  10. #include <Db.hpp>
  11. #include <DBCtrls.hpp>
  12. #include <Grids.hpp>
  13. #include <Graphics.hpp>
  14. #include <StdCtrls.hpp>
  15. #include <Forms.hpp>
  16. #include <Controls.hpp>
  17. #include <Classes.hpp>
  18. #include <Messages.hpp>
  19. #include <SysUtils.hpp>
  20. #include <Windows.hpp>
  21. #include <SysInit.hpp>
  22. #include <System.hpp>
  23.  
  24. //-- user supplied -----------------------------------------------------------
  25.  
  26. namespace Dbgrids
  27. {
  28. //-- type declarations -------------------------------------------------------
  29. enum TColumnValue { cvColor, cvWidth, cvFont, cvAlignment, cvReadOnly, cvTitleColor, cvTitleCaption, 
  30.     cvTitleAlignment, cvTitleFont, cvImeMode, cvImeName };
  31.  
  32. typedef Set<TColumnValue, cvColor, cvImeName>  TColumnValues;
  33.  
  34. class DELPHICLASS TColumnTitle;
  35. class DELPHICLASS TColumn;
  36. enum TColumnButtonStyle { cbsAuto, cbsEllipsis, cbsNone };
  37.  
  38. class DELPHICLASS TCustomDBGrid;
  39. class PASCALIMPLEMENTATION TColumn : public Classes::TCollectionItem 
  40. {
  41.     typedef Classes::TCollectionItem inherited;
  42.     
  43. private:
  44.     Db::TField* FField;
  45.     System::AnsiString FFieldName;
  46.     Graphics::TColor FColor;
  47.     int FWidth;
  48.     TColumnTitle* FTitle;
  49.     Graphics::TFont* FFont;
  50.     TImeMode FImeMode;
  51.     System::AnsiString FImeName;
  52.     Classes::TStrings* FPickList;
  53.     Menus::TPopupMenu* FPopupMenu;
  54.     Cardinal FDropDownRows;
  55.     TColumnButtonStyle FButtonStyle;
  56.     TAlignment FAlignment;
  57.     bool FReadonly;
  58.     TColumnValues FAssignedValues;
  59.     void __fastcall FontChanged(System::TObject* Sender);
  60.     Classes::TAlignment __fastcall GetAlignment(void);
  61.     Graphics::TColor __fastcall GetColor(void);
  62.     Db::TField* __fastcall GetField(void);
  63.     Graphics::TFont* __fastcall GetFont(void);
  64.     Controls::TImeMode __fastcall GetImeMode(void);
  65.     System::AnsiString __fastcall GetImeName(void);
  66.     Classes::TStrings* __fastcall GetPickList(void);
  67.     bool __fastcall GetReadOnly(void);
  68.     int __fastcall GetWidth(void);
  69.     bool __fastcall IsAlignmentStored(void);
  70.     bool __fastcall IsColorStored(void);
  71.     bool __fastcall IsFontStored(void);
  72.     bool __fastcall IsImeModeStored(void);
  73.     bool __fastcall IsImeNameStored(void);
  74.     bool __fastcall IsReadOnlyStored(void);
  75.     bool __fastcall IsWidthStored(void);
  76.     virtual void __fastcall SetAlignment(Classes::TAlignment Value);
  77.     void __fastcall SetButtonStyle(TColumnButtonStyle Value);
  78.     void __fastcall SetColor(Graphics::TColor Value);
  79.     virtual void __fastcall SetField(Db::TField* Value);
  80.     void __fastcall SetFieldName(const System::AnsiString Value);
  81.     void __fastcall SetFont(Graphics::TFont* Value);
  82.     virtual void __fastcall SetImeMode(Controls::TImeMode Value);
  83.     virtual void __fastcall SetImeName(System::AnsiString Value);
  84.     void __fastcall SetPickList(Classes::TStrings* Value);
  85.     void __fastcall SetPopupMenu(Menus::TPopupMenu* Value);
  86.     virtual void __fastcall SetReadOnly(bool Value);
  87.     void __fastcall SetTitle(TColumnTitle* Value);
  88.     virtual void __fastcall SetWidth(int Value);
  89.     
  90. protected:
  91.     virtual TColumnTitle* __fastcall CreateTitle(void);
  92.     TCustomDBGrid* __fastcall GetGrid(void);
  93.     virtual System::AnsiString __fastcall GetDisplayName(void);
  94.     void __fastcall RefreshDefaultFont(void);
  95.     
  96. public:
  97.     __fastcall virtual TColumn(Classes::TCollection* Collection);
  98.     __fastcall virtual ~TColumn(void);
  99.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  100.     Classes::TAlignment __fastcall DefaultAlignment(void);
  101.     Graphics::TColor __fastcall DefaultColor(void);
  102.     Graphics::TFont* __fastcall DefaultFont(void);
  103.     Controls::TImeMode __fastcall DefaultImeMode(void);
  104.     System::AnsiString __fastcall DefaultImeName(void);
  105.     bool __fastcall DefaultReadOnly(void);
  106.     int __fastcall DefaultWidth(void);
  107.     virtual void __fastcall RestoreDefaults(void);
  108.     __property TCustomDBGrid* Grid = {read=GetGrid};
  109.     __property TColumnValues AssignedValues = {read=FAssignedValues, nodefault};
  110.     __property Db::TField* Field = {read=GetField, write=SetField};
  111.     
  112. __published:
  113.     __property Classes::TAlignment Alignment = {read=GetAlignment, write=SetAlignment, stored=IsAlignmentStored
  114.         , nodefault};
  115.     __property TColumnButtonStyle ButtonStyle = {read=FButtonStyle, write=SetButtonStyle, default=0};
  116.     __property Graphics::TColor Color = {read=GetColor, write=SetColor, stored=IsColorStored, nodefault
  117.         };
  118.     __property Cardinal DropDownRows = {read=FDropDownRows, write=FDropDownRows, default=7};
  119.     __property System::AnsiString FieldName = {read=FFieldName, write=SetFieldName};
  120.     __property Graphics::TFont* Font = {read=GetFont, write=SetFont, stored=IsFontStored};
  121.     __property Controls::TImeMode ImeMode = {read=GetImeMode, write=SetImeMode, stored=IsImeModeStored, 
  122.         nodefault};
  123.     __property System::AnsiString ImeName = {read=GetImeName, write=SetImeName, stored=IsImeNameStored}
  124.         ;
  125.     __property Classes::TStrings* PickList = {read=GetPickList, write=SetPickList};
  126.     __property Menus::TPopupMenu* PopupMenu = {read=FPopupMenu, write=SetPopupMenu};
  127.     __property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, stored=IsReadOnlyStored, nodefault
  128.         };
  129.     __property TColumnTitle* Title = {read=FTitle, write=SetTitle};
  130.     __property int Width = {read=GetWidth, write=SetWidth, stored=IsWidthStored, nodefault};
  131. };
  132.  
  133. class PASCALIMPLEMENTATION TColumnTitle : public Classes::TPersistent 
  134. {
  135.     typedef Classes::TPersistent inherited;
  136.     
  137. private:
  138.     TColumn* FColumn;
  139.     System::AnsiString FCaption;
  140.     Graphics::TFont* FFont;
  141.     Graphics::TColor FColor;
  142.     TAlignment FAlignment;
  143.     void __fastcall FontChanged(System::TObject* Sender);
  144.     Classes::TAlignment __fastcall GetAlignment(void);
  145.     Graphics::TColor __fastcall GetColor(void);
  146.     System::AnsiString __fastcall GetCaption(void);
  147.     Graphics::TFont* __fastcall GetFont(void);
  148.     bool __fastcall IsAlignmentStored(void);
  149.     bool __fastcall IsColorStored(void);
  150.     bool __fastcall IsFontStored(void);
  151.     bool __fastcall IsCaptionStored(void);
  152.     void __fastcall SetAlignment(Classes::TAlignment Value);
  153.     void __fastcall SetColor(Graphics::TColor Value);
  154.     void __fastcall SetFont(Graphics::TFont* Value);
  155.     virtual void __fastcall SetCaption(const System::AnsiString Value);
  156.     
  157. protected:
  158.     void __fastcall RefreshDefaultFont(void);
  159.     
  160. public:
  161.     __fastcall TColumnTitle(TColumn* Column);
  162.     __fastcall virtual ~TColumnTitle(void);
  163.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  164.     Classes::TAlignment __fastcall DefaultAlignment(void);
  165.     Graphics::TColor __fastcall DefaultColor(void);
  166.     Graphics::TFont* __fastcall DefaultFont(void);
  167.     System::AnsiString __fastcall DefaultCaption(void);
  168.     virtual void __fastcall RestoreDefaults(void);
  169.     
  170. __published:
  171.     __property Classes::TAlignment Alignment = {read=GetAlignment, write=SetAlignment, stored=IsAlignmentStored
  172.         , nodefault};
  173.     __property System::AnsiString Caption = {read=GetCaption, write=SetCaption, stored=IsCaptionStored}
  174.         ;
  175.     __property Graphics::TColor Color = {read=GetColor, write=SetColor, stored=IsColorStored, nodefault
  176.         };
  177.     __property Graphics::TFont* Font = {read=GetFont, write=SetFont, stored=IsFontStored};
  178. };
  179.  
  180. typedef System::TMetaClass*TColumnClass;
  181.  
  182. enum TDBGridColumnsState { csDefault, csCustomized };
  183.  
  184. class DELPHICLASS TDBGridColumns;
  185. class PASCALIMPLEMENTATION TDBGridColumns : public Classes::TCollection 
  186. {
  187.     typedef Classes::TCollection inherited;
  188.     
  189. private:
  190.     TCustomDBGrid* FGrid;
  191.     TColumn* __fastcall GetColumn(int Index);
  192.     TDBGridColumnsState __fastcall GetState(void);
  193.     void __fastcall SetColumn(int Index, TColumn* Value);
  194.     void __fastcall SetState(TDBGridColumnsState NewState);
  195.     
  196. protected:
  197.     DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
  198.     virtual void __fastcall Update(Classes::TCollectionItem* Item);
  199.     
  200. public:
  201.     __fastcall TDBGridColumns(TCustomDBGrid* Grid, System::TMetaClass* ColumnClass);
  202.     HIDESBASE TColumn* __fastcall Add(void);
  203.     void __fastcall LoadFromFile(const System::AnsiString Filename);
  204.     void __fastcall LoadFromStream(Classes::TStream* S);
  205.     void __fastcall RestoreDefaults(void);
  206.     void __fastcall RebuildColumns(void);
  207.     void __fastcall SaveToFile(const System::AnsiString Filename);
  208.     void __fastcall SaveToStream(Classes::TStream* S);
  209.     __property TDBGridColumnsState State = {read=GetState, write=SetState, nodefault};
  210.     __property TCustomDBGrid* Grid = {read=FGrid};
  211.     __property TColumn* Items[int Index] = {read=GetColumn, write=SetColumn/*, default*/};
  212. public:
  213.     /* TCollection.Destroy */ __fastcall virtual ~TDBGridColumns(void) { }
  214.     
  215. };
  216.  
  217. class DELPHICLASS TGridDataLink;
  218. class PASCALIMPLEMENTATION TGridDataLink : public Db::TDataLink 
  219. {
  220.     typedef Db::TDataLink inherited;
  221.     
  222. private:
  223.     TCustomDBGrid* FGrid;
  224.     int FFieldCount;
  225.     int FFieldMapSize;
  226.     void *FFieldMap;
  227.     bool FModified;
  228.     bool FInUpdateData;
  229.     bool FSparseMap;
  230.     bool __fastcall GetDefaultFields(void);
  231.     Db::TField* __fastcall GetFields(int I);
  232.     
  233. protected:
  234.     virtual void __fastcall ActiveChanged(void);
  235.     virtual void __fastcall DataSetChanged(void);
  236.     virtual void __fastcall DataSetScrolled(int Distance);
  237.     virtual void __fastcall FocusControl(Db::TFieldRef Field);
  238.     virtual void __fastcall EditingChanged(void);
  239.     virtual void __fastcall LayoutChanged(void);
  240.     virtual void __fastcall RecordChanged(Db::TField* Field);
  241.     virtual void __fastcall UpdateData(void);
  242.     int __fastcall GetMappedIndex(int ColIndex);
  243.     
  244. public:
  245.     __fastcall TGridDataLink(TCustomDBGrid* AGrid);
  246.     __fastcall virtual ~TGridDataLink(void);
  247.     bool __fastcall AddMapping(const System::AnsiString FieldName);
  248.     void __fastcall ClearMapping(void);
  249.     void __fastcall Modified(void);
  250.     void __fastcall Reset(void);
  251.     __property bool DefaultFields = {read=GetDefaultFields, nodefault};
  252.     __property int FieldCount = {read=FFieldCount, nodefault};
  253.     __property Db::TField* Fields[int I] = {read=GetFields};
  254.     __property bool SparseMap = {read=FSparseMap, write=FSparseMap, nodefault};
  255. };
  256.  
  257. class DELPHICLASS TBookmarkList;
  258. class PASCALIMPLEMENTATION TBookmarkList : public System::TObject 
  259. {
  260.     typedef System::TObject inherited;
  261.     
  262. private:
  263.     Classes::TStringList* FList;
  264.     TCustomDBGrid* FGrid;
  265.     System::AnsiString FCache;
  266.     int FCacheIndex;
  267.     bool FCacheFind;
  268.     bool FLinkActive;
  269.     int __fastcall GetCount(void);
  270.     bool __fastcall GetCurrentRowSelected(void);
  271.     System::AnsiString __fastcall GetItem(int Index);
  272.     void __fastcall SetCurrentRowSelected(bool Value);
  273.     void __fastcall StringsChanged(System::TObject* Sender);
  274.     
  275. protected:
  276.     System::AnsiString __fastcall CurrentRow(void);
  277.     int __fastcall Compare(const System::AnsiString Item1, const System::AnsiString Item2);
  278.     void __fastcall LinkActive(bool Value);
  279.     
  280. public:
  281.     __fastcall TBookmarkList(TCustomDBGrid* AGrid);
  282.     __fastcall virtual ~TBookmarkList(void);
  283.     void __fastcall Clear(void);
  284.     void __fastcall Delete(void);
  285.     bool __fastcall Find(const System::AnsiString Item, int &Index);
  286.     int __fastcall IndexOf(const System::AnsiString Item);
  287.     bool __fastcall Refresh(void);
  288.     __property int Count = {read=GetCount, nodefault};
  289.     __property bool CurrentRowSelected = {read=GetCurrentRowSelected, write=SetCurrentRowSelected, nodefault
  290.         };
  291.     __property System::AnsiString Items[int Index] = {read=GetItem/*, default*/};
  292. };
  293.  
  294. enum TDBGridOption { dgEditing, dgAlwaysShowEditor, dgTitles, dgIndicator, dgColumnResize, dgColLines, 
  295.     dgRowLines, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiSelect 
  296.     };
  297.  
  298. typedef Set<TDBGridOption, dgEditing, dgMultiSelect>  TDBGridOptions;
  299.  
  300. typedef void __fastcall (__closure *TDrawDataCellEvent)(System::TObject* Sender, const Windows::TRect 
  301.     &Rect, Db::TField* Field, Grids::TGridDrawState State);
  302.  
  303. typedef void __fastcall (__closure *TDrawColumnCellEvent)(System::TObject* Sender, const Windows::TRect 
  304.     &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState State);
  305.  
  306. typedef void __fastcall (__closure *TDBGridClickEvent)(TColumn* Column);
  307.  
  308. class PASCALIMPLEMENTATION TCustomDBGrid : public Grids::TCustomGrid 
  309. {
  310.     typedef Grids::TCustomGrid inherited;
  311.     
  312. private:
  313.     Controls::TImageList* FIndicators;
  314.     Graphics::TFont* FTitleFont;
  315.     bool FReadOnly;
  316.     System::AnsiString FOriginalImeName;
  317.     TImeMode FOriginalImeMode;
  318.     bool FUserChange;
  319.     bool FIsESCKey;
  320.     bool FLayoutFromDataset;
  321.     TDBGridOptions FOptions;
  322.     Byte FTitleOffset;
  323.     Byte FIndicatorOffset;
  324.     Byte FUpdateLock;
  325.     Byte FLayoutLock;
  326.     bool FInColExit;
  327.     bool FDefaultDrawing;
  328.     bool FSelfChangingTitleFont;
  329.     bool FSelecting;
  330.     int FSelRow;
  331.     TGridDataLink* FDataLink;
  332.     Classes::TNotifyEvent FOnColEnter;
  333.     Classes::TNotifyEvent FOnColExit;
  334.     TDrawDataCellEvent FOnDrawDataCell;
  335.     TDrawColumnCellEvent FOnDrawColumnCell;
  336.     System::AnsiString FEditText;
  337.     TDBGridColumns* FColumns;
  338.     Classes::TNotifyEvent FOnEditButtonClick;
  339.     Grids::TMovedEvent FOnColumnMoved;
  340.     TBookmarkList* FBookmarks;
  341.     System::AnsiString FSelectionAnchor;
  342.     TDBGridClickEvent FOnCellClick;
  343.     TDBGridClickEvent FOnTitleClick;
  344.     bool __fastcall AcquireFocus(void);
  345.     void __fastcall DataChanged(void);
  346.     void __fastcall EditingChanged(void);
  347.     Db::TDataSource* __fastcall GetDataSource(void);
  348.     int __fastcall GetFieldCount(void);
  349.     Db::TField* __fastcall GetFields(int FieldIndex);
  350.     Db::TField* __fastcall GetSelectedField(void);
  351.     int __fastcall GetSelectedIndex(void);
  352.     void __fastcall InternalLayout(void);
  353.     void __fastcall MoveCol(int RawCol);
  354.     void __fastcall ReadColumns(Classes::TReader* Reader);
  355.     void __fastcall RecordChanged(Db::TField* Field);
  356.     HIDESBASE void __fastcall SetIme(void);
  357.     void __fastcall SetColumns(TDBGridColumns* Value);
  358.     void __fastcall SetDataSource(Db::TDataSource* Value);
  359.     HIDESBASE void __fastcall SetOptions(TDBGridOptions Value);
  360.     void __fastcall SetSelectedField(Db::TField* Value);
  361.     void __fastcall SetSelectedIndex(int Value);
  362.     void __fastcall SetTitleFont(Graphics::TFont* Value);
  363.     void __fastcall TitleFontChanged(System::TObject* Sender);
  364.     void __fastcall UpdateData(void);
  365.     void __fastcall UpdateActive(void);
  366.     void __fastcall UpdateIme(void);
  367.     void __fastcall UpdateScrollBar(void);
  368.     void __fastcall UpdateRowCount(void);
  369.     void __fastcall WriteColumns(Classes::TWriter* Writer);
  370.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TMessage &Message);
  371.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  372.     HIDESBASE MESSAGE void __fastcall CMParentFontChanged(Messages::TMessage &Message);
  373.     MESSAGE void __fastcall CMDeferLayout(void *Message);
  374.     HIDESBASE MESSAGE void __fastcall CMDesignHitTest(Messages::TWMMouse &Msg);
  375.     HIDESBASE MESSAGE void __fastcall WMSetCursor(Messages::TWMSetCursor &Msg);
  376.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  377.     HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Message);
  378.     HIDESBASE MESSAGE void __fastcall WMIMEStartComp(Messages::TMessage &Message);
  379.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  380.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TMessage &Message);
  381.     
  382. protected:
  383.     bool FUpdateFields;
  384.     bool FAcquireFocus;
  385.     int __fastcall RawToDataColumn(int ACol);
  386.     int __fastcall DataToRawColumn(int ACol);
  387.     bool __fastcall AcquireLayoutLock(void);
  388.     void __fastcall BeginLayout(void);
  389.     void __fastcall BeginUpdate(void);
  390.     void __fastcall CancelLayout(void);
  391.     DYNAMIC bool __fastcall CanEditAcceptKey(char Key);
  392.     DYNAMIC bool __fastcall CanEditModify(void);
  393.     virtual bool __fastcall CanEditShow(void);
  394.     DYNAMIC void __fastcall CellClick(TColumn* Column);
  395.     DYNAMIC void __fastcall ColumnMoved(int FromIndex, int ToIndex);
  396.     DYNAMIC void __fastcall ColEnter(void);
  397.     DYNAMIC void __fastcall ColExit(void);
  398.     DYNAMIC void __fastcall ColWidthsChanged(void);
  399.     DYNAMIC TDBGridColumns* __fastcall CreateColumns(void);
  400.     virtual Grids::TInplaceEdit* __fastcall CreateEditor(void);
  401.     virtual void __fastcall CreateWnd(void);
  402.     void __fastcall DeferLayout(void);
  403.     virtual void __fastcall DefaultHandler(void *Msg);
  404.     virtual void __fastcall DefineFieldMap(void);
  405.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  406.     virtual void __fastcall DrawCell(int ACol, int ARow, const Windows::TRect &ARect, Grids::TGridDrawState 
  407.         AState);
  408.     DYNAMIC void __fastcall DrawDataCell(const Windows::TRect &Rect, Db::TField* Field, Grids::TGridDrawState 
  409.         State);
  410.     DYNAMIC void __fastcall DrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState 
  411.         State);
  412.     DYNAMIC void __fastcall EditButtonClick(void);
  413.     void __fastcall EndLayout(void);
  414.     void __fastcall EndUpdate(void);
  415.     Db::TField* __fastcall GetColField(int DataCol);
  416.     DYNAMIC int __fastcall GetEditLimit(void);
  417.     DYNAMIC System::AnsiString __fastcall GetEditMask(int ACol, int ARow);
  418.     DYNAMIC System::AnsiString __fastcall GetEditText(int ACol, int ARow);
  419.     System::AnsiString __fastcall GetFieldValue(int ACol);
  420.     virtual bool __fastcall HighlightCell(int DataCol, int DataRow, const System::AnsiString Value, Grids::TGridDrawState 
  421.         AState);
  422.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  423.     DYNAMIC void __fastcall KeyPress(char &Key);
  424.     virtual void __fastcall LayoutChanged(void);
  425.     virtual void __fastcall LinkActive(bool Value);
  426.     virtual void __fastcall Loaded(void);
  427.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  428.         int Y);
  429.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  430.         Y);
  431.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  432.         );
  433.     virtual void __fastcall Scroll(int Distance);
  434.     virtual void __fastcall SetColumnAttributes(void);
  435.     DYNAMIC void __fastcall SetEditText(int ACol, int ARow, const System::AnsiString Value);
  436.     bool __fastcall StoreColumns(void);
  437.     DYNAMIC void __fastcall TimedScroll(Grids::TGridScrollDirection Direction);
  438.     DYNAMIC void __fastcall TitleClick(TColumn* Column);
  439.     __property TDBGridColumns* Columns = {read=FColumns, write=SetColumns};
  440.     __property bool DefaultDrawing = {read=FDefaultDrawing, write=FDefaultDrawing, default=1};
  441.     __property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource};
  442.     __property TGridDataLink* DataLink = {read=FDataLink};
  443.     __property Byte IndicatorOffset = {read=FIndicatorOffset, nodefault};
  444.     __property Byte LayoutLock = {read=FLayoutLock, nodefault};
  445.     __property TDBGridOptions Options = {read=FOptions, write=SetOptions, default=3325};
  446.     __property ParentColor ;
  447.     __property bool ReadOnly = {read=FReadOnly, write=FReadOnly, default=0};
  448.     __property TBookmarkList* SelectedRows = {read=FBookmarks};
  449.     __property Graphics::TFont* TitleFont = {read=FTitleFont, write=SetTitleFont};
  450.     __property Byte UpdateLock = {read=FUpdateLock, nodefault};
  451.     __property Classes::TNotifyEvent OnColEnter = {read=FOnColEnter, write=FOnColEnter};
  452.     __property Classes::TNotifyEvent OnColExit = {read=FOnColExit, write=FOnColExit};
  453.     __property TDrawDataCellEvent OnDrawDataCell = {read=FOnDrawDataCell, write=FOnDrawDataCell};
  454.     __property TDrawColumnCellEvent OnDrawColumnCell = {read=FOnDrawColumnCell, write=FOnDrawColumnCell
  455.         };
  456.     __property Classes::TNotifyEvent OnEditButtonClick = {read=FOnEditButtonClick, write=FOnEditButtonClick
  457.         };
  458.     __property Grids::TMovedEvent OnColumnMoved = {read=FOnColumnMoved, write=FOnColumnMoved};
  459.     __property TDBGridClickEvent OnCellClick = {read=FOnCellClick, write=FOnCellClick};
  460.     __property TDBGridClickEvent OnTitleClick = {read=FOnTitleClick, write=FOnTitleClick};
  461.     
  462. public:
  463.     __fastcall virtual TCustomDBGrid(Classes::TComponent* AOwner);
  464.     __fastcall virtual ~TCustomDBGrid(void);
  465.     void __fastcall DefaultDrawDataCell(const Windows::TRect &Rect, Db::TField* Field, Grids::TGridDrawState 
  466.         State);
  467.     void __fastcall DefaultDrawColumnCell(const Windows::TRect &Rect, int DataCol, TColumn* Column, Grids::TGridDrawState 
  468.         State);
  469.     bool __fastcall ValidFieldIndex(int FieldIndex);
  470.     __property EditorMode ;
  471.     __property int FieldCount = {read=GetFieldCount, nodefault};
  472.     __property Db::TField* Fields[int FieldIndex] = {read=GetFields};
  473.     __property Db::TField* SelectedField = {read=GetSelectedField, write=SetSelectedField};
  474.     __property int SelectedIndex = {read=GetSelectedIndex, write=SetSelectedIndex, nodefault};
  475. public:
  476.     /* TWinControl.CreateParented */ __fastcall TCustomDBGrid(HWND ParentWindow) : Grids::TCustomGrid(ParentWindow
  477.         ) { }
  478.     
  479. };
  480.  
  481. class DELPHICLASS TDBGrid;
  482. class PASCALIMPLEMENTATION TDBGrid : public Dbgrids::TCustomDBGrid 
  483. {
  484.     typedef Dbgrids::TCustomDBGrid inherited;
  485.     
  486. public:
  487.     __property Canvas ;
  488.     __property SelectedRows ;
  489.     
  490. __published:
  491.     __property Align ;
  492.     __property BorderStyle ;
  493.     __property Color ;
  494.     __property Columns  = {stored=false};
  495.     __property Ctl3D ;
  496.     __property DataSource ;
  497.     __property DefaultDrawing ;
  498.     __property DragCursor ;
  499.     __property DragMode ;
  500.     __property Enabled ;
  501.     __property FixedColor ;
  502.     __property Font ;
  503.     __property ImeMode ;
  504.     __property ImeName ;
  505.     __property Options ;
  506.     __property ParentColor ;
  507.     __property ParentCtl3D ;
  508.     __property ParentFont ;
  509.     __property ParentShowHint ;
  510.     __property PopupMenu ;
  511.     __property ReadOnly ;
  512.     __property ShowHint ;
  513.     __property TabOrder ;
  514.     __property TabStop ;
  515.     __property TitleFont ;
  516.     __property Visible ;
  517.     __property OnCellClick ;
  518.     __property OnColEnter ;
  519.     __property OnColExit ;
  520.     __property OnColumnMoved ;
  521.     __property OnDrawDataCell ;
  522.     __property OnDrawColumnCell ;
  523.     __property OnDblClick ;
  524.     __property OnDragDrop ;
  525.     __property OnDragOver ;
  526.     __property OnEditButtonClick ;
  527.     __property OnEndDrag ;
  528.     __property OnEnter ;
  529.     __property OnExit ;
  530.     __property OnKeyDown ;
  531.     __property OnKeyPress ;
  532.     __property OnKeyUp ;
  533.     __property OnStartDrag ;
  534.     __property OnTitleClick ;
  535. public:
  536.     /* TCustomDBGrid.Create */ __fastcall virtual TDBGrid(Classes::TComponent* AOwner) : Dbgrids::TCustomDBGrid(
  537.         AOwner) { }
  538.     /* TCustomDBGrid.Destroy */ __fastcall virtual ~TDBGrid(void) { }
  539.     
  540. public:
  541.     /* TWinControl.CreateParented */ __fastcall TDBGrid(HWND ParentWindow) : Dbgrids::TCustomDBGrid(ParentWindow
  542.         ) { }
  543.     
  544. };
  545.  
  546. //-- var, const, procedure ---------------------------------------------------
  547. #define ColumnTitleValues (System::Set<TColumnValue, cvColor, cvImeName> () << cvTitleColor << cvTitleCaption \
  548.     << cvTitleAlignment << cvTitleFont )
  549. #define cm_DeferLayout (Word)(1124)
  550. #define IndicatorWidth (Byte)(11)
  551.  
  552. }    /* namespace Dbgrids */
  553. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  554. using namespace Dbgrids;
  555. #endif
  556. //-- end unit ----------------------------------------------------------------
  557. #endif    // DBGrids
  558.